//
//  Test39.cpp
//  CPPTest
//
//  Created by you5 Yi on 2021/9/28.
//

#include "Test39.hpp"
#include <iostream>
using namespace std;

class Base
{
public:
    virtual void Print() const {
        cout<<"Base::Print"<<endl;
    }
};

class ClassA: public Base
{
public:
    void Print() const {
        cout<<"ClassA::Print"<<endl;
    }
};

class ClassB: public Base
{
public:
    void Print() const {
        cout<<"ClassB::Print"<<endl;
    }
};

void Print(Base &obj) {
    obj.Print();
}

void test39() {
    ClassA a;
    ClassB b;
    Print(a);
    Print(b);
}
